﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Trackr.Core
{
	public class TrackrDataHandler
	{
		private DataAccess.ITrackrDataStore _dataStore;
		public TrackrDataHandler(DataAccess.ITrackrDataStore store)
		{
			_dataStore = store;
		}
		public TrackrDataHandler()
		{
			_dataStore = DataAccess.Resolver.Get<DataAccess.ITrackrDataStore>();
		}
		public void Save(Model.TimeItem item)
		{
			_dataStore.Save(item);
		}
		public IEnumerable<Model.TimeItem> GetAll()
		{
			return _dataStore.GetAll();
		}
		public IEnumerable<Model.TimeItem> GetAll(DateTime from, DateTime to)
		{
			return _dataStore.GetAll(from, to);
		}
		public Model.TimeItem Get(int id)
		{
			return _dataStore.Get(id);
		}
		public void Delete(Model.TimeItem item)
		{
			_dataStore.Delete(item);
		}
	}
}
